package org.ihelpuoo.weboo.checkers;

import java.util.regex.Pattern;

import org.ihelpuoo.lang.StringUtils;

public class TextChecker extends AbstractChecker
{
	private Pattern	pattern;

	public boolean isValid(String value)
	{
		if (StringUtils.isEmpty(value))
			return true;
		if (!pattern.matcher(value).matches())
			return false;
		return true;
	}

	public void setSetting(String setting)
	{
		pattern = Pattern.compile(setting);
	}

}
